package com.yuyi.kotlindemo.login

import android.annotation.SuppressLint
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProviders
import com.yuyi.kotlindemo.databinding.ActivityLoginBinding

/**
 * MVPPlugin
 * 邮箱 784787081@qq.com
 */
class LoginActivity : AppCompatActivity() {
    private var binding: ActivityLoginBinding? = null
    private var loginViewModel: LoginViewModel? = null

    @SuppressLint("InflateParams")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

//        loginViewModel = ViewModelProvider(this).get(LoginViewModel :: class.java)
        loginViewModel = ViewModelProviders.of(this).get(LoginViewModel::class.java)
        binding = ActivityLoginBinding.inflate(LayoutInflater.from(this))
        setContentView(binding!!.root)

        binding!!.loginBtn.setOnClickListener(View.OnClickListener {
            Log.e(
                "输入内容",
                binding!!.phoneEdit.text.toString() + binding!!.passwordEdit.text.toString()
            )
        })


    }

}